package com.aitaoxue.palx.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.BaseAdapter;

public abstract class MyBaseAdapter<T> extends BaseAdapter {
	
	protected boolean isLinkViewClick=false;
	protected Context context;
	protected List<T> listData;
	protected LayoutInflater listContainer;
	
	public MyBaseAdapter(Context context,List<T> data){
		this.context=context;
		this.listContainer=LayoutInflater.from(context);
		this.listData=data;
	}
	
	public boolean isLinkViewClick(){
		return isLinkViewClick;
	}
	
	public void setLinkViewClick(boolean isLinkViewClick){
		this.isLinkViewClick=isLinkViewClick;
	}
	
	@Override
	public int getCount() {
		return listData.size();
	}
	
	@Override
	public T getItem(int arg0) {
		return listData.get(arg0);
	}
	
	@Override
	public long getItemId(int arg0) {
		return arg0;
	}
	
	protected abstract int getResourceId();
	
	protected View getAdapterView(int resourceId){
		return listContainer.inflate(resourceId, null);
	}
}





